//
//  STLUsage.hpp
//  CppDemo
//
//  Created by 蒋益杰 on 16/5/19.
//  Copyright © 2016年 com.ed. All rights reserved.
//

#ifndef STLUsage_hpp
#define STLUsage_hpp

#include <stdio.h>
#include <string>
#include <vector>

typedef struct NODE {
    NODE *pLeft;
    NODE *pRight;
    int nMaxLeft;
    int nMaxRight;
    char chValue;
} NODE;



struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};

typedef struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
} TreeNode;

class STLUsage
{
public:
    STLUsage() : nCode(0), name("hello") {}
    void print(const std::string& s);
    
    static std::vector<int> topKFrequent(std::vector<int>& nums, int k);
    static TreeNode* buildTree(std::vector<int>& inorder, std::vector<int>& postorder);
    
private:
    int nCode = 0;
    std::string name;
};

enum IntStatus {
    kValid = 0,
    kInvalid,
};

//int g_status______ = kValid;

int strToInt(const char *str);

int findNumAppearOnce(int data[], int length);

#endif /* STLUsage_hpp */
